package homework_02.home02;

/**
 * 由命令行输入一个4位整数，求将该数反转以后的数，如原数为1234，反转后的数位4321。
 */
import java.util.Scanner;
public class test16 {
    public static void main(String[] args) {
        System.out.println("请输入一个数");
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        if(x>999 && x<=9999){
            int gewei = x%10;
            int shiwei = x % 100 / 10;
            int baiwei = x%1000/100;
            int qianwei = x/1000;
            int sum = qianwei + baiwei*10 +shiwei*100 +gewei*1000;
            System.out.println(sum);
        }
        else{
            System.out.println("error");
        }

    }
}
